/*oOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoO*/
/*
This files contains functions declarations related to server of HW assignment 1. 

Created by Amir Balva for the course "Introduction To Systems Programming", 
School of Electrical Engineering, Tel-Aviv University. winter 2014.
*/
/*oOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoO*/

#ifndef HW1_SERVER_H
#define HW1_SERVER_H

#include "HW1_Types.h" 
#include <stdio.h>

/*
 * Initializes the Server communication module, Call this function before calling any other Server function. 
 * 
 * Input:
 * -----
 * A string used to initialize the server module ( should be supplied to you from outside your program ).
 */ 
void Initilize_Server(const char * SetupString);

/*
 * Gets an array of new emails from the server 
 * 
 * Input:
 * -----
 * number_of_emails - used as an additional output. A valid integer memory address must be provided
 *
 * Output:
 * -----
 * number_of_emails - will be updated to the number of emails included in the array
 * Return Value:
 * array of Email type or NULL (if 0 emails retrived from the server)
 */ 
Email * Get_Emails_From_Server (int* number_of_emails);
/*
 * Send an email to the server
 * 
 * Input:
 * -----
 * Email* email - an email to be send to the server
 */
void Send_Email (Email* email);
/*
 * Turns the Server Module off, and releases all resources.
 * IMPORTANT: this function should only be called if you have called
 * Server_Initialize() before.
 */ 
void Close_Server();

#endif // HW1_SERVER_H